#ifndef PLAYER_MANAGER_H
#define PLAYER_MANAGER_H
#include <singleton.h>
#include <boost/pool/object_pool.hpp>
#include <typedef.h>
#include <map>

class CPlayer
{
public:
    CPlayer(uint32 nUserID);
    uint32 GetUserID();
private:
    uint32 m_nUserID;
};

class CPlayerMgr : public CSingleton<CPlayerMgr>
{
    typedef std::map<uint64, CPlayer *> TPlayerList;
    typedef boost::object_pool<CPlayer> TPlayerPool;
public:
    CPlayerMgr(void);
    ~CPlayerMgr(void);

    CPlayer * AddPlayer(uint64 nProxyID, uint32 nUserID);

    void Remove(uint64 nProxyID);

    CPlayer * Find(uint64 nProxyID);
private:
    CPlayer * _CreatePlayer(uint64 nProxyID, uint32 nUserID);
private:
    TPlayerList m_playerList;
    TPlayerPool m_playerPool;

};

#endif  // endif of PLAYER_MANAGER_H
